3.78 \(\int e^{x^2} \sin (a+b x+c x^2) \, dx\)

Optimal. Leaf size=155 \[ -\frac{i \sqrt{\pi } e^{-i \left (a-\frac{b^2}{4 c+4 i}\right )} \text{Erfi}\left (\frac{i b-2 (1-i c) x}{2 \sqrt{1-i c}}\right )}{4 \sqrt{1-i c}}-\frac{i \sqrt{\pi } e^{i a+\frac{b^2}{4 (1+i c)}} \text{Erfi}\left (\frac{i b+2 (1+i c) x}{2 \sqrt{1+i c}}\right )}{4 \sqrt{1+i c}} \]

[Out]

((-I/4)*Sqrt[Pi]*Erfi[(I*b - 2*(1 - I*c)*x)/(2*Sqrt[1 - I*c])])/(Sqrt[1 - I*c]*E^(I*(a - b^2/(4*I + 4*c)))) -
((I/4)*E^(I*a + b^2/(4*(1 + I*c)))*Sqrt[Pi]*Erfi[(I*b + 2*(1 + I*c)*x)/(2*Sqrt[1 + I*c])])/Sqrt[1 + I*c]

________________________________________________________________________________________

Rubi [A]  time = 0.201997, antiderivative size = 155, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 3, integrand size = 17, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.176, Rules used = {4472, 2234, 2204} \[ -\frac{i \sqrt{\pi } e^{-i \left (a-\frac{b^2}{4 c+4 i}\right )} \text{Erfi}\left (\frac{i b-2 (1-i c) x}{2 \sqrt{1-i c}}\right )}{4 \sqrt{1-i c}}-\frac{i \sqrt{\pi } e^{i a+\frac{b^2}{4 (1+i c)}} \text{Erfi}\left (\frac{i b+2 (1+i c) x}{2 \sqrt{1+i c}}\right )}{4 \sqrt{1+i c}} \]

Antiderivative was successfully verified.

[In]

Int[E^x^2*Sin[a + b*x + c*x^2],x]

[Out]

((-I/4)*Sqrt[Pi]*Erfi[(I*b - 2*(1 - I*c)*x)/(2*Sqrt[1 - I*c])])/(Sqrt[1 - I*c]*E^(I*(a - b^2/(4*I + 4*c)))) -
((I/4)*E^(I*a + b^2/(4*(1 + I*c)))*Sqrt[Pi]*Erfi[(I*b + 2*(1 + I*c)*x)/(2*Sqrt[1 + I*c])])/Sqrt[1 + I*c]

Rule 4472

Int[(F_)^(u_)*Sin[v_]^(n_.), x_Symbol] :> Int[ExpandTrigToExp[F^u, Sin[v]^n, x], x] /; FreeQ[F, x] && (LinearQ
[u, x] || PolyQ[u, x, 2]) && (LinearQ[v, x] || PolyQ[v, x, 2]) && IGtQ[n, 0]

Rule 2234

Int[(F_)^((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[F^(a - b^2/(4*c)), Int[F^((b + 2*c*x)^2/(4*c))
, x], x] /; FreeQ[{F, a, b, c}, x]

Rule 2204

Int[(F_)^((a_.) + (b_.)*((c_.) + (d_.)*(x_))^2), x_Symbol] :> Simp[(F^a*Sqrt[Pi]*Erfi[(c + d*x)*Rt[b*Log[F], 2
]])/(2*d*Rt[b*Log[F], 2]), x] /; FreeQ[{F, a, b, c, d}, x] && PosQ[b]

Rubi steps

\begin{align*} \int e^{x^2} \sin \left (a+b x+c x^2\right ) \, dx &=\int \left (\frac{1}{2} i e^{-i a-i b x+(1-i c) x^2}-\frac{1}{2} i e^{i a+i b x+(1+i c) x^2}\right ) \, dx\\ &=\frac{1}{2} i \int e^{-i a-i b x+(1-i c) x^2} \, dx-\frac{1}{2} i \int e^{i a+i b x+(1+i c) x^2} \, dx\\ &=-\left (\frac{1}{2} \left (i e^{i a+\frac{b^2}{4 (1+i c)}}\right ) \int \exp \left (\frac{(i b+2 (1+i c) x)^2}{4 (1+i c)}\right ) \, dx\right )+\frac{1}{2} \left (i e^{-i \left (a-\frac{b^2}{4 i+4 c}\right )}\right ) \int \exp \left (\frac{(-i b+2 (1-i c) x)^2}{4 (1-i c)}\right ) \, dx\\ &=-\frac{i e^{-i \left (a-\frac{b^2}{4 i+4 c}\right )} \sqrt{\pi } \text{erfi}\left (\frac{i b-2 (1-i c) x}{2 \sqrt{1-i c}}\right )}{4 \sqrt{1-i c}}-\frac{i e^{i a+\frac{b^2}{4 (1+i c)}} \sqrt{\pi } \text{erfi}\left (\frac{i b+2 (1+i c) x}{2 \sqrt{1+i c}}\right )}{4 \sqrt{1+i c}}\\ \end{align*}

Mathematica [A]  time = 0.562098, size = 165, normalized size = 1.06 \[ -\frac{(-1)^{3/4} \sqrt{\pi } e^{\frac{i b^2}{-4 c+4 i}} \left ((c-i) \sqrt{c+i} e^{\frac{i b^2 c}{2 c^2+2}} (\cos (a)-i \sin (a)) \text{Erfi}\left (\frac{(-1)^{3/4} (b+2 (c+i) x)}{2 \sqrt{c+i}}\right )+\sqrt{c-i} (c+i) (\sin (a)-i \cos (a)) \text{Erfi}\left (\frac{\sqrt [4]{-1} (b+2 (c-i) x)}{2 \sqrt{c-i}}\right )\right )}{4 \left (c^2+1\right )} \]

Antiderivative was successfully verified.

[In]

Integrate[E^x^2*Sin[a + b*x + c*x^2],x]

[Out]

-((-1)^(3/4)*E^((I*b^2)/(4*I - 4*c))*Sqrt[Pi]*((-I + c)*Sqrt[I + c]*E^((I*b^2*c)/(2 + 2*c^2))*Erfi[((-1)^(3/4)
*(b + 2*(I + c)*x))/(2*Sqrt[I + c])]*(Cos[a] - I*Sin[a]) + Sqrt[-I + c]*(I + c)*Erfi[((-1)^(1/4)*(b + 2*(-I +
c)*x))/(2*Sqrt[-I + c])]*((-I)*Cos[a] + Sin[a])))/(4*(1 + c^2))

________________________________________________________________________________________

Maple [A]  time = 0.208, size = 127, normalized size = 0.8 \begin{align*}{{\frac{i}{4}}\sqrt{\pi }{{\rm e}^{{\frac{-4\,ac+4\,ia+{b}^{2}}{4\,ic+4}}}}{\it Erf} \left ( -\sqrt{-ic-1}x+{{\frac{i}{2}}b{\frac{1}{\sqrt{-ic-1}}}} \right ){\frac{1}{\sqrt{-ic-1}}}}+{{\frac{i}{4}}\sqrt{\pi }{{\rm e}^{{\frac{4\,ia+4\,ac-{b}^{2}}{4\,ic-4}}}}{\it Erf} \left ( \sqrt{-1+ic}x+{{\frac{i}{2}}b{\frac{1}{\sqrt{-1+ic}}}} \right ){\frac{1}{\sqrt{-1+ic}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(exp(x^2)*sin(c*x^2+b*x+a),x)

[Out]

1/4*I*Pi^(1/2)*exp(1/4*(-4*a*c+4*I*a+b^2)/(1+I*c))/(-I*c-1)^(1/2)*erf(-(-I*c-1)^(1/2)*x+1/2*I*b/(-I*c-1)^(1/2)
)+1/4*I*Pi^(1/2)*exp(1/4*(4*I*a+4*a*c-b^2)/(-1+I*c))/(-1+I*c)^(1/2)*erf((-1+I*c)^(1/2)*x+1/2*I*b/(-1+I*c)^(1/2
))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: IndexError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x^2)*sin(c*x^2+b*x+a),x, algorithm="maxima")

[Out]

Exception raised: IndexError

________________________________________________________________________________________

Fricas [A]  time = 0.499874, size = 427, normalized size = 2.75 \begin{align*} -\frac{\sqrt{\pi }{\left (c - i\right )} \sqrt{i \, c - 1} \operatorname{erf}\left (-\frac{{\left (b c + 2 \,{\left (c^{2} + 1\right )} x - i \, b\right )} \sqrt{i \, c - 1}}{2 \,{\left (c^{2} + 1\right )}}\right ) e^{\left (\frac{i \, b^{2} c - 4 i \, a c^{2} + b^{2} - 4 i \, a}{4 \,{\left (c^{2} + 1\right )}}\right )} - \sqrt{\pi }{\left (c + i\right )} \sqrt{-i \, c - 1} \operatorname{erf}\left (\frac{{\left (b c + 2 \,{\left (c^{2} + 1\right )} x + i \, b\right )} \sqrt{-i \, c - 1}}{2 \,{\left (c^{2} + 1\right )}}\right ) e^{\left (\frac{-i \, b^{2} c + 4 i \, a c^{2} + b^{2} + 4 i \, a}{4 \,{\left (c^{2} + 1\right )}}\right )}}{4 \,{\left (c^{2} + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x^2)*sin(c*x^2+b*x+a),x, algorithm="fricas")

[Out]

-1/4*(sqrt(pi)*(c - I)*sqrt(I*c - 1)*erf(-1/2*(b*c + 2*(c^2 + 1)*x - I*b)*sqrt(I*c - 1)/(c^2 + 1))*e^(1/4*(I*b
^2*c - 4*I*a*c^2 + b^2 - 4*I*a)/(c^2 + 1)) - sqrt(pi)*(c + I)*sqrt(-I*c - 1)*erf(1/2*(b*c + 2*(c^2 + 1)*x + I*
b)*sqrt(-I*c - 1)/(c^2 + 1))*e^(1/4*(-I*b^2*c + 4*I*a*c^2 + b^2 + 4*I*a)/(c^2 + 1)))/(c^2 + 1)

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int e^{x^{2}} \sin{\left (a + b x + c x^{2} \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x**2)*sin(c*x**2+b*x+a),x)

[Out]

Integral(exp(x**2)*sin(a + b*x + c*x**2), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int e^{\left (x^{2}\right )} \sin \left (c x^{2} + b x + a\right )\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(exp(x^2)*sin(c*x^2+b*x+a),x, algorithm="giac")

[Out]

integrate(e^(x^2)*sin(c*x^2 + b*x + a), x)